﻿#ifndef ITEMEDIT_H
#define ITEMEDIT_H

#include "support/sp_env.h"
#include "common/baseeditordialog.h"
#include "itemview.h"
#include "itemadd.h"

namespace Ui {
class ItemEdit;
}

class ItemEdit : public BaseEditorDialog
{
    Q_OBJECT

public:
    explicit ItemEdit(QWidget *parent, const QString &table);
    ~ItemEdit();

    void updateView();
    void generateMenu();
    void removeItem();
    void newItem();
    void editItem();
    void display(const QString &detail);

protected:
    void closeEvent(QCloseEvent *);

private slots:
    void on_tableView_clicked(const QModelIndex &index);

private:
    Ui::ItemEdit *ui;

    QString _table;
    ItemView *view;
};

#endif // ITEMEDIT_H
